package com.education.welco.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.welco.mapper.SCatalogPreviewSynMapper;
import com.education.welco.pojo.SCatalogPreviewSyn;
import com.education.welco.service.ISCatalogPreviewSynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 备课查看课程预习 服务层实现
 *
 * @author d
 * @date 2020-05-14
 */
@Service
public class SCatalogPreviewSynServiceImpl implements ISCatalogPreviewSynService {

    @Autowired
    private SCatalogPreviewSynMapper sCatalogPreviewSynMapper;

    /**
     * 查询备课查看课程预习信息
     *
     * @param id 备课查看课程预习ID
     * @return 备课查看课程预习信息
     */
    @Override
    public SCatalogPreviewSyn selectSCatalogPreviewSynById(Integer id) {
        return sCatalogPreviewSynMapper.selectSCatalogPreviewSynById(id);
    }

    /**
     * 查询备课查看课程预习列表
     *
     * @param sCatalogPreviewSyn 备课查看课程预习信息
     * @return 备课查看课程预习集合
     */
    @Override
    public List<SCatalogPreviewSyn> selectSCatalogPreviewSynList(SCatalogPreviewSyn sCatalogPreviewSyn) {
        return sCatalogPreviewSynMapper.selectSCatalogPreviewSynList(sCatalogPreviewSyn);
    }

    /**
     * 新增备课查看课程预习
     *
     * @param sCatalogPreviewSyn 备课查看课程预习信息
     * @return 结果
     */
    @Override
    public int insertSCatalogPreviewSyn(SCatalogPreviewSyn sCatalogPreviewSyn) {
        return sCatalogPreviewSynMapper.insertSCatalogPreviewSyn(sCatalogPreviewSyn);
    }

    /**
     * 删除备课查看课程预习
     *
     * @param catalogId 备课查看课程预习ID
     * @return 结果
     */
    @Override
    public int deleteSCatalogPreviewSynByCatalogId(Integer catalogId) {
        return sCatalogPreviewSynMapper.deleteSCatalogPreviewSynByCatalogId(catalogId);
    }

    /**
     * 修改备课查看课程预习
     *
     * @param sCatalogPreviewSyn 备课查看课程预习信息
     * @return 结果
     */
    @Override
    public int updateSCatalogPreviewSyn(SCatalogPreviewSyn sCatalogPreviewSyn) {
        return sCatalogPreviewSynMapper.updateSCatalogPreviewSyn(sCatalogPreviewSyn);
    }

    /**
     * 删除备课查看课程预习对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSCatalogPreviewSynByIds(String ids) {
        return sCatalogPreviewSynMapper.deleteSCatalogPreviewSynByIds(Convert.toStrArray(ids));
    }
}